import request from "@/utils/request";


//课时校准
export function keshijiaozhuan(data) {
	return request({
		url: "/api/v1/vip/contract/keshijiaozhuan",
		method: "get",
		params: data,
	});
}

//即将过期
export function jijiangjieyeWeb() {
	return request({
		url: "/api/v1/vip/contract/jijiangjieyeWeb",
		method: "get",
	});
}

//延期3个月
export function yanqi(data) {
	return request({
		url: "/api/v1/vip/contract/yanqi",
		method: "post",
		data,
	});
}

export function getList(data) {
	return request({
		url: "/api/v1/vip/contract/findPage",
		method: "get",
		params: data,
	});
}

export function getById(data) {
	return request({
		url: "/api/v1/approve/handle/findPage",
		method: "get",
		params: data,
	});
}

export function getListById(data) {
	return request({
		url: "/api/v1/vip/contract/getListById",
		method: "get",
		params: data,
	});
}

export function doUpdateHandle(data) {
	return request({
		url: "/api/v1/approve/handle/update",
		method: "post",
		data,
	});
}

export function editContract(data) {
	return request({
		url: "/api/v1/vip/contract/editContract",
		method: "post",
		data,
	});
}

export function doInsert(data) {
	return request({
		url: "/api/v1/vip/contract/insert",
		method: "post",
		data,
	});
}

export function doUpdate(data) {
	return request({
		url: "/api/v1/vip/contract/update",
		method: "post",
		data,
	});
}

export function doDelete(data) {
	return request({
		url: "/api/v1/vip/contract/del",
		method: "post",
		params: data,
	});
}

export function doDeleteAll(data) {
	return request({
		url: "/api/v1/vip/contract/delAll",
		method: "post",
		params: data,
	});
}

/**
 * 导出Excel 目前只支持一层参数传递
 * @param data
 * @returns file
 */
export function doExportExcel(data) {
	let requestURL = "/api/v1/vip/contract/exportExcel";
	// 下载文件
	downloadFileByData(requestURL, data);
}

/**
 * 下载模版
 * @returns file
 */
export function doDownloadTemplate() {
	let data = {};
	let requestURL = "/api/v1/vip/contract/importExcel/template";
	// 下载文件
	downloadFileByData(requestURL, data);
}

/**
 * 导入Excel
 * @returns file
 */
export function doImportExcel(data) {
	return request({
		url: "/api/v1/vip/contract/importExcel",
		method: "post",
		// 最长超时时间 3 分钟
		timeout: 180000,
		headers: {
			"Content-Type": "multipart/form-data",
		},
		data,
	});
}